/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package assisisw.smartcal.webuisubsystem.managedbean.calendar;

import assisisw.smartcal.entitysubsystem.Calendar;
import assisisw.smartcal.entitysubsystem.ICalendarController;
import assisisw.smartcal.webuisubsystem.managedbean.DashboardBean;
import java.io.Serializable;
import javax.ejb.EJB;
import javax.faces.context.FacesContext;
import static javax.faces.context.FacesContext.getCurrentInstance;

/**
 *
 * @author Francesco
 */
public abstract class AbstractCalendarControllerBean implements Serializable
{

    // Instance Fields

    /***/
    @EJB ()
    private ICalendarController calendarController ;
     
    /***/
    private Calendar managedCalendar ;
    
    /***/
    private String newSharedMail ;
    
    /***/
    private boolean calendarEditable = true ;
    
    // Instance Methods
    
    /***/
    public AbstractCalendarControllerBean () {}
    
    /***/
    public abstract void calendarViewConfirmationCommand () ;
    
    /***/
    public void calendarViewShareCommand () {}
    
    /***/
    public void calendarViewDeleteCommand () {}
  
    /**
     * @param managedCalendar 
     */
    public void setManagedCalendar ( Calendar managedCalendar ) 
    {
        this.managedCalendar = managedCalendar ;
    }
    
    /**
     * @return
     */
    public Calendar getManagedCalendar () 
    {
        return managedCalendar ;
    }
    
    /**
     * @param newSharedMail 
     */
    public void setNewSharedMail ( String newSharedMail ) 
    {
        this.newSharedMail = newSharedMail ;
    }
    
    /**
     * @return
     */
    public String getNewSharedMail () 
    {
        return newSharedMail ;
    }
    
    /**
     * @return
     */
    public boolean isCalendarEditable () 
    {
        return calendarEditable ;
    }
    
    /**
     * @param calendarEditable 
     */
    public void setCalendarEditable ( boolean calendarEditable ) 
    {
        this.calendarEditable = calendarEditable ;
    }
    
    /**
     * @return
     */
    protected ICalendarController getCalendarController () 
    {
        return calendarController ;
    }
    
    /**
     * @return
     */
    protected DashboardBean getDashboardBean () 
    {
        DashboardBean dashboardBean ;
        dashboardBean = getCurrentInstance().getApplication().evaluateExpressionGet(FacesContext.getCurrentInstance(), "#{dashboardBean}",DashboardBean.class);
        return dashboardBean ;
    }
    
}
